<!doctype html>
<html>
  <head>
    <title>Getting Started Extension's Popup</title>
    <style>
      body {
        min-width:357px;
        overflow-x:hidden;
      }

      img {
        margin:5px;
        border:2px solid black;
        vertical-align:middle;
        width:75px;
        height:75px;
      }
    </style>

    <!-- JavaScript and HTML must be in separate files for security. -->
    <script src="popup.js"></script>
	<script>
		chrome.browserAction.onClicked.addListener(function(tab) {
		  chrome.tabs.sendRequest(tab.id, {method: "getSelection"}, function(response){
			 sendServiceRequest(response.data);
		  });
		});

		function sendServiceRequest(selectedText) {
		  var serviceCall = 'http://www.google.com/search?q=' + selectedText;
		  chrome.tabs.create({url: serviceCall});
		}
	</script>
  </head>
  <body>

  </body>
</html>